3.989 \(\int \frac{(1-a x)^{1-n} (1+a x)^{1+n}}{x^2} \, dx\)

Optimal. Leaf size=131 \[ -\frac{\left (a^2 x^2+1\right ) (a x+1)^n (1-a x)^{-n}}{x}-\frac{2 a n (a x+1)^{n-1} (1-a x)^{1-n} \, _2F_1\left (1,1-n;2-n;\frac{1-a x}{a x+1}\right )}{1-n}+\frac{a 2^{-n} n (a x+1)^{n+1} \, _2F_1\left (n+1,n+1;n+2;\frac{1}{2} (a x+1)\right )}{n+1} \]

[Out]

-(((1 + a*x)^n*(1 + a^2*x^2))/(x*(1 - a*x)^n)) - (2*a*n*(1 - a*x)^(1 - n)*(1 + a
*x)^(-1 + n)*Hypergeometric2F1[1, 1 - n, 2 - n, (1 - a*x)/(1 + a*x)])/(1 - n) +
(a*n*(1 + a*x)^(1 + n)*Hypergeometric2F1[1 + n, 1 + n, 2 + n, (1 + a*x)/2])/(2^n
*(1 + n))

_______________________________________________________________________________________

Rubi [C]  time = 0.0668912, antiderivative size = 48, normalized size of antiderivative = 0.37, number of steps used = 1, number of rules used = 1, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.04 \[ \frac{a 2^{1-n} (a x+1)^{n+2} F_1\left (n+2;n-1,2;n+3;\frac{1}{2} (a x+1),a x+1\right )}{n+2} \]

Warning: Unable to verify antiderivative.

[In]  Int[((1 - a*x)^(1 - n)*(1 + a*x)^(1 + n))/x^2,x]

[Out]

(2^(1 - n)*a*(1 + a*x)^(2 + n)*AppellF1[2 + n, -1 + n, 2, 3 + n, (1 + a*x)/2, 1
+ a*x])/(2 + n)

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 6.50365, size = 36, normalized size = 0.27 \[ \frac{2^{- n + 1} a \left (a x + 1\right )^{n + 2} \operatorname{appellf_{1}}{\left (n + 2,2,n - 1,n + 3,a x + 1,\frac{a x}{2} + \frac{1}{2} \right )}}{n + 2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((-a*x+1)**(1-n)*(a*x+1)**(1+n)/x**2,x)

[Out]

2**(-n + 1)*a*(a*x + 1)**(n + 2)*appellf1(n + 2, 2, n - 1, n + 3, a*x + 1, a*x/2
 + 1/2)/(n + 2)

_______________________________________________________________________________________

Mathematica [C]  time = 0.416634, size = 158, normalized size = 1.21 \[ a (a x+1)^n \left (-\frac{2 (1-a x)^{-n} F_1\left (1;n,-n;2;\frac{1}{a x},-\frac{1}{a x}\right )}{2 a x F_1\left (1;n,-n;2;\frac{1}{a x},-\frac{1}{a x}\right )+n \left (F_1\left (2;n,1-n;3;\frac{1}{a x},-\frac{1}{a x}\right )+F_1\left (2;n+1,-n;3;\frac{1}{a x},-\frac{1}{a x}\right )\right )}-\frac{2^{-n} (a x+1) \, _2F_1\left (n,n+1;n+2;\frac{1}{2} (a x+1)\right )}{n+1}\right ) \]

Warning: Unable to verify antiderivative.

[In]  Integrate[((1 - a*x)^(1 - n)*(1 + a*x)^(1 + n))/x^2,x]

[Out]

a*(1 + a*x)^n*((-2*AppellF1[1, n, -n, 2, 1/(a*x), -(1/(a*x))])/((1 - a*x)^n*(2*a
*x*AppellF1[1, n, -n, 2, 1/(a*x), -(1/(a*x))] + n*(AppellF1[2, n, 1 - n, 3, 1/(a
*x), -(1/(a*x))] + AppellF1[2, 1 + n, -n, 3, 1/(a*x), -(1/(a*x))]))) - ((1 + a*x
)*Hypergeometric2F1[n, 1 + n, 2 + n, (1 + a*x)/2])/(2^n*(1 + n)))

_______________________________________________________________________________________

Maple [F]  time = 0.076, size = 0, normalized size = 0. \[ \int{\frac{ \left ( -ax+1 \right ) ^{1-n} \left ( ax+1 \right ) ^{1+n}}{{x}^{2}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((-a*x+1)^(1-n)*(a*x+1)^(1+n)/x^2,x)

[Out]

int((-a*x+1)^(1-n)*(a*x+1)^(1+n)/x^2,x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (a x + 1\right )}^{n + 1}{\left (-a x + 1\right )}^{-n + 1}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a*x + 1)^(n + 1)*(-a*x + 1)^(-n + 1)/x^2,x, algorithm="maxima")

[Out]

integrate((a*x + 1)^(n + 1)*(-a*x + 1)^(-n + 1)/x^2, x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{{\left (a x + 1\right )}^{n + 1}{\left (-a x + 1\right )}^{-n + 1}}{x^{2}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a*x + 1)^(n + 1)*(-a*x + 1)^(-n + 1)/x^2,x, algorithm="fricas")

[Out]

integral((a*x + 1)^(n + 1)*(-a*x + 1)^(-n + 1)/x^2, x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-a*x+1)**(1-n)*(a*x+1)**(1+n)/x**2,x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (a x + 1\right )}^{n + 1}{\left (-a x + 1\right )}^{-n + 1}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a*x + 1)^(n + 1)*(-a*x + 1)^(-n + 1)/x^2,x, algorithm="giac")

[Out]

integrate((a*x + 1)^(n + 1)*(-a*x + 1)^(-n + 1)/x^2, x)